NimbusSdJwtOps

object NimbusSdJwtOps : SdJwtSerializationOps<SignedJWT> , SdJwtPresentationOps<SignedJWT> , SdJwtVerifier<SignedJWT> (source)

Properties

Link copied to clipboard
val HolderPubKeyInConfirmationClaim: (JsonObject) -> AsymmetricJWK?

This is a dual of cnf function Obtains holder's pub key from claims

Link copied to clipboard

Functions

Link copied to clipboard
open override fun SdJwt<SignedJWT>.asJwsJsonObject(option: JwsSerializationOption): JsonObject

Creates a representation of an SdJwt as a JWS JSON according to RFC7515. In addition to the General & Flattened representations defined in the RFC7515, the result JSON contains an unprotected header which includes an array with the disclosures

Link copied to clipboard
open suspend override fun SdJwt<SignedJWT>.asJwsJsonObjectWithKeyBinding(option: JwsSerializationOption, buildKbJwt: BuildKbJwt): Result<JsonObject>

Creates a representation of an SdJwt as a JWS JSON according to RFC7515. In addition to the General & Flattened representations defined in the RFC7515, the result JSON contains an unprotected header which includes an array with the disclosures of the SdJwt and the key binding JWT

open override fun SdJwt<SignedJWT>.asJwsJsonObjectWithKeyBinding(option: JwsSerializationOption, kbJwt: Jwt): JsonObject
Link copied to clipboard
fun JWSVerifier.asJwtVerifier(): JwtSignatureVerifier<SignedJWT>

An adapter that converts a NimbusJWSVerifier into a JwtSignatureVerifier

fun JWTProcessor<*>.asJwtVerifier(): JwtSignatureVerifier<SignedJWT>

An adapter that converts a NimbusJWTProcessor into a JwtSignatureVerifier

Link copied to clipboard
fun issuer(sdJwtFactory: SdJwtFactory = SdJwtFactory.Default, signer: JWSSigner, signAlgorithm: JWSAlgorithm, jwsHeaderCustomization: JWSHeader.Builder.() -> Unit = {}): SdJwtIssuer<SignedJWT>

Factory method for creating a SdJwtIssuer that uses Nimbus

Link copied to clipboard
fun kbJwtIssuer(signer: JWSSigner, signAlgorithm: JWSAlgorithm, publicKey: AsymmetricJWK, claimSetBuilderAction: JWTClaimsSet.Builder.() -> Unit = {}): BuildKbJwt
Link copied to clipboard
fun KeyBindingVerifier.Companion.mustBePresentAndValid(holderPubKeyExtractor: (JsonObject) -> AsymmetricJWK? = HolderPubKeyInConfirmationClaim, challenge: JsonObject? = null): KeyBindingVerifier.MustBePresentAndValid<SignedJWT>

Factory method for creating a KeyBindingVerifier which applies the rules described in keyBindingJWTProcess.

Link copied to clipboard
open override fun SdJwt<SignedJWT>.present(query: Set<ClaimPath>): SdJwt<SignedJWT>?

Tries to create a presentation that discloses the requested claims.

Link copied to clipboard
open override fun SdJwt<SignedJWT>.recreateClaims(visitor: ClaimVisitor?): JsonObject

Recreates the claims, used to produce the SD-JWT That are:

Link copied to clipboard
open override fun SdJwt<SignedJWT>.recreateClaimsAndDisclosuresPerClaim(): Pair<JsonObject, DisclosuresPerClaimPath>

Recreates the claims, used to produce the SD-JWT and at the same time calculates DisclosuresPerClaimPath

Link copied to clipboard
open override fun SdJwt<SignedJWT>.serialize(): String

Serializes a SdJwt without a key binding JWT.

Link copied to clipboard
open suspend override fun SdJwt<SignedJWT>.serializeWithKeyBinding(buildKbJwt: BuildKbJwt): Result<String>
open override fun SdJwt<SignedJWT>.serializeWithKeyBinding(kbJwt: Jwt): String

Serializes a SdJwt with a Key Binding JWT.

Link copied to clipboard
open suspend override fun verify(jwtSignatureVerifier: JwtSignatureVerifier<SignedJWT>, unverifiedSdJwt: String): Result<SdJwt<SignedJWT>>

Verifies an SD-JWT serialized using compact serialization.

open suspend override fun verify(jwtSignatureVerifier: JwtSignatureVerifier<SignedJWT>, unverifiedSdJwt: JsonObject): Result<SdJwt<SignedJWT>>

Verifies an SD-JWT serialized using JWS JSON serialization (either general or flattened format) as defined by RFC7515 and extended by SD-JWT specification.

open suspend override fun verify(jwtSignatureVerifier: JwtSignatureVerifier<SignedJWT>, keyBindingVerifier: KeyBindingVerifier.MustBePresentAndValid<SignedJWT>, unverifiedSdJwt: String): Result<SdJwtAndKbJwt<SignedJWT>>

Verifies a SD-JWT+KB serialized using compact serialization.

open suspend override fun verify(jwtSignatureVerifier: JwtSignatureVerifier<SignedJWT>, keyBindingVerifier: KeyBindingVerifier.MustBePresentAndValid<SignedJWT>, unverifiedSdJwt: JsonObject): Result<SdJwtAndKbJwt<SignedJWT>>

Verifies a SD-JWT+KB in JWS JSON serialization.